3.5.80 \(\int \cos (c+d x) (a+b \sec (c+d x))^4 \, dx\) [480]

Optimal. Leaf size=104 \[ 4 a^3 b x+\frac {b^2 \left (12 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {a^2 \left (2 a^2-b^2\right ) \sin (c+d x)}{2 d}+\frac {b^2 (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {3 a b^3 \tan (c+d x)}{d} \]

[Out]

4*a^3*b*x+1/2*b^2*(12*a^2+b^2)*arctanh(sin(d*x+c))/d+1/2*a^2*(2*a^2-b^2)*sin(d*x+c)/d+1/2*b^2*(a+b*sec(d*x+c))
^2*sin(d*x+c)/d+3*a*b^3*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.15, antiderivative size = 104, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {3927, 4161, 4132, 8, 4130, 3855} \begin {gather*} 4 a^3 b x+\frac {a^2 \left (2 a^2-b^2\right ) \sin (c+d x)}{2 d}+\frac {b^2 \left (12 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {3 a b^3 \tan (c+d x)}{d}+\frac {b^2 \sin (c+d x) (a+b \sec (c+d x))^2}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*(a + b*Sec[c + d*x])^4,x]

[Out]

4*a^3*b*x + (b^2*(12*a^2 + b^2)*ArcTanh[Sin[c + d*x]])/(2*d) + (a^2*(2*a^2 - b^2)*Sin[c + d*x])/(2*d) + (b^2*(
a + b*Sec[c + d*x])^2*Sin[c + d*x])/(2*d) + (3*a*b^3*Tan[c + d*x])/d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3927

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Simp[(-b^2)
*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m - 2)*((d*Csc[e + f*x])^n/(f*(m + n - 1))), x] + Dist[1/(d*(m + n - 1)),
Int[(a + b*Csc[e + f*x])^(m - 3)*(d*Csc[e + f*x])^n*Simp[a^3*d*(m + n - 1) + a*b^2*d*n + b*(b^2*d*(m + n - 2)
+ 3*a^2*d*(m + n - 1))*Csc[e + f*x] + a*b^2*d*(3*m + 2*n - 4)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, d, e,
 f, n}, x] && NeQ[a^2 - b^2, 0] && GtQ[m, 2] && (IntegerQ[m] || IntegersQ[2*m, 2*n]) &&  !(IGtQ[n, 2] &&  !Int
egerQ[m])

Rule 4130

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[A*Cot[e
+ f*x]*((b*Csc[e + f*x])^m/(f*m)), x] + Dist[(C*m + A*(m + 1))/(b^2*m), Int[(b*Csc[e + f*x])^(m + 2), x], x] /
; FreeQ[{b, e, f, A, C}, x] && NeQ[C*m + A*(m + 1), 0] && LeQ[m, -1]

Rule 4132

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(
C_.)), x_Symbol] :> Dist[B/b, Int[(b*Csc[e + f*x])^(m + 1), x], x] + Int[(b*Csc[e + f*x])^m*(A + C*Csc[e + f*x
]^2), x] /; FreeQ[{b, e, f, A, B, C, m}, x]

Rule 4161

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^
(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(-b)*C*Csc[e + f*x]*Cot[e + f*x]*((d*Csc[e + f
*x])^n/(f*(n + 2))), x] + Dist[1/(n + 2), Int[(d*Csc[e + f*x])^n*Simp[A*a*(n + 2) + (B*a*(n + 2) + b*(C*(n + 1
) + A*(n + 2)))*Csc[e + f*x] + (a*C + B*b)*(n + 2)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, d, e, f, A, B, C
, n}, x] &&  !LtQ[n, -1]

Rubi steps

\begin {align*} \int \cos (c+d x) (a+b \sec (c+d x))^4 \, dx &=\frac {b^2 (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {1}{2} \int \cos (c+d x) (a+b \sec (c+d x)) \left (a \left (2 a^2-b^2\right )+b \left (6 a^2+b^2\right ) \sec (c+d x)+6 a b^2 \sec ^2(c+d x)\right ) \, dx\\ &=\frac {b^2 (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {3 a b^3 \tan (c+d x)}{d}+\frac {1}{2} \int \cos (c+d x) \left (a^2 \left (2 a^2-b^2\right )+8 a^3 b \sec (c+d x)+b^2 \left (12 a^2+b^2\right ) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {b^2 (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {3 a b^3 \tan (c+d x)}{d}+\frac {1}{2} \int \cos (c+d x) \left (a^2 \left (2 a^2-b^2\right )+b^2 \left (12 a^2+b^2\right ) \sec ^2(c+d x)\right ) \, dx+\left (4 a^3 b\right ) \int 1 \, dx\\ &=4 a^3 b x+\frac {a^2 \left (2 a^2-b^2\right ) \sin (c+d x)}{2 d}+\frac {b^2 (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {3 a b^3 \tan (c+d x)}{d}+\frac {1}{2} \left (b^2 \left (12 a^2+b^2\right )\right ) \int \sec (c+d x) \, dx\\ &=4 a^3 b x+\frac {b^2 \left (12 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {a^2 \left (2 a^2-b^2\right ) \sin (c+d x)}{2 d}+\frac {b^2 (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {3 a b^3 \tan (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(280\) vs. \(2(104)=208\).
time = 0.55, size = 280, normalized size = 2.69 \begin {gather*} \frac {\sec ^2(c+d x) \left (8 a^3 b c+8 a^3 b d x-12 a^2 b^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-b^4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+12 a^2 b^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+b^4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+b \cos (2 (c+d x)) \left (8 a^3 (c+d x)-b \left (12 a^2+b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+b \left (12 a^2+b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+\left (a^4+2 b^4\right ) \sin (c+d x)+8 a b^3 \sin (2 (c+d x))+a^4 \sin (3 (c+d x))\right )}{4 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*(a + b*Sec[c + d*x])^4,x]

[Out]

(Sec[c + d*x]^2*(8*a^3*b*c + 8*a^3*b*d*x - 12*a^2*b^2*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - b^4*Log[Cos[(
c + d*x)/2] - Sin[(c + d*x)/2]] + 12*a^2*b^2*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + b^4*Log[Cos[(c + d*x)/
2] + Sin[(c + d*x)/2]] + b*Cos[2*(c + d*x)]*(8*a^3*(c + d*x) - b*(12*a^2 + b^2)*Log[Cos[(c + d*x)/2] - Sin[(c
+ d*x)/2]] + b*(12*a^2 + b^2)*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) + (a^4 + 2*b^4)*Sin[c + d*x] + 8*a*b^3
*Sin[2*(c + d*x)] + a^4*Sin[3*(c + d*x)]))/(4*d)

________________________________________________________________________________________

Maple [A]
time = 0.11, size = 96, normalized size = 0.92

method result size
derivativedivides \(\frac {a^{4} \sin \left (d x +c \right )+4 b \,a^{3} \left (d x +c \right )+6 b^{2} a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 b^{3} a \tan \left (d x +c \right )+b^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(96\)
default \(\frac {a^{4} \sin \left (d x +c \right )+4 b \,a^{3} \left (d x +c \right )+6 b^{2} a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 b^{3} a \tan \left (d x +c \right )+b^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(96\)
risch \(4 a^{3} b x -\frac {i a^{4} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a^{4} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {i b^{3} \left (b \,{\mathrm e}^{3 i \left (d x +c \right )}-8 a \,{\mathrm e}^{2 i \left (d x +c \right )}-b \,{\mathrm e}^{i \left (d x +c \right )}-8 a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {6 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2} a^{2}}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{4}}{2 d}-\frac {6 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2} a^{2}}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{4}}{2 d}\) \(196\)
norman \(\frac {\frac {\left (2 a^{4}-8 b^{3} a +b^{4}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {\left (6 a^{4}+8 b^{3} a -b^{4}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-4 a^{3} b x -\frac {\left (2 a^{4}+8 b^{3} a +b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {\left (6 a^{4}-8 b^{3} a -b^{4}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+8 a^{3} b x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-8 a^{3} b x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+4 a^{3} b x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {b^{2} \left (12 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {b^{2} \left (12 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) \(277\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(a+b*sec(d*x+c))^4,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^4*sin(d*x+c)+4*b*a^3*(d*x+c)+6*b^2*a^2*ln(sec(d*x+c)+tan(d*x+c))+4*b^3*a*tan(d*x+c)+b^4*(1/2*sec(d*x+c)
*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c))))

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 115, normalized size = 1.11 \begin {gather*} \frac {16 \, {\left (d x + c\right )} a^{3} b - b^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, a^{2} b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, a^{4} \sin \left (d x + c\right ) + 16 \, a b^{3} \tan \left (d x + c\right )}{4 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^4,x, algorithm="maxima")

[Out]

1/4*(16*(d*x + c)*a^3*b - b^4*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c)
- 1)) + 12*a^2*b^2*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 4*a^4*sin(d*x + c) + 16*a*b^3*tan(d*x + c
))/d

________________________________________________________________________________________

Fricas [A]
time = 3.20, size = 130, normalized size = 1.25 \begin {gather*} \frac {16 \, a^{3} b d x \cos \left (d x + c\right )^{2} + {\left (12 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (12 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, a^{4} \cos \left (d x + c\right )^{2} + 8 \, a b^{3} \cos \left (d x + c\right ) + b^{4}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^4,x, algorithm="fricas")

[Out]

1/4*(16*a^3*b*d*x*cos(d*x + c)^2 + (12*a^2*b^2 + b^4)*cos(d*x + c)^2*log(sin(d*x + c) + 1) - (12*a^2*b^2 + b^4
)*cos(d*x + c)^2*log(-sin(d*x + c) + 1) + 2*(2*a^4*cos(d*x + c)^2 + 8*a*b^3*cos(d*x + c) + b^4)*sin(d*x + c))/
(d*cos(d*x + c)^2)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right )^{4} \cos {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))**4,x)

[Out]

Integral((a + b*sec(c + d*x))**4*cos(c + d*x), x)

________________________________________________________________________________________

Giac [A]
time = 0.45, size = 179, normalized size = 1.72 \begin {gather*} \frac {8 \, {\left (d x + c\right )} a^{3} b + \frac {4 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + {\left (12 \, a^{2} b^{2} + b^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (12 \, a^{2} b^{2} + b^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (8 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 8 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^4,x, algorithm="giac")

[Out]

1/2*(8*(d*x + c)*a^3*b + 4*a^4*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1) + (12*a^2*b^2 + b^4)*log(abs(
tan(1/2*d*x + 1/2*c) + 1)) - (12*a^2*b^2 + b^4)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(8*a*b^3*tan(1/2*d*x +
1/2*c)^3 - b^4*tan(1/2*d*x + 1/2*c)^3 - 8*a*b^3*tan(1/2*d*x + 1/2*c) - b^4*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x
+ 1/2*c)^2 - 1)^2)/d

________________________________________________________________________________________

Mupad [B]
time = 1.04, size = 152, normalized size = 1.46 \begin {gather*} \frac {a^4\,\sin \left (c+d\,x\right )}{d}+\frac {b^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {b^4\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2}+\frac {12\,a^2\,b^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {8\,a^3\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,a\,b^3\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)*(a + b/cos(c + d*x))^4,x)

[Out]

(a^4*sin(c + d*x))/d + (b^4*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (b^4*sin(c + d*x))/(2*d*cos(c +
d*x)^2) + (12*a^2*b^2*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (8*a^3*b*atan(sin(c/2 + (d*x)/2)/cos(c
/2 + (d*x)/2)))/d + (4*a*b^3*sin(c + d*x))/(d*cos(c + d*x))

________________________________________________________________________________________